<script>
$(document).ready(function() {
//选择一级区域
$('#oneid').change(function(){
	$("#stwoid").html('<img src="'+siteUrl+'static/images/loading.gif" />');
	var oneid = $(this).children('option:selected').val();  //弹出select的值
	
	if(oneid==0){
		$("#stwoid").html('');
		$("#sthreeid").html('');
	}else{
		$("#sthreeid").html('');
		$.ajax({
			type: "GET",
			url:  "{{url('home/user/area/two')}}",
			data: "oneid="+oneid,
			success: function(msg){
				$("#stwoid").html(msg);
				
				//选择二级区域
				$('#twoid').change(function(){
					$("#sthreeid").html('<img src="'+siteUrl+'static/images/loading.gif" />');
					var twoid = $(this).children('option:selected').val();  //弹出select的值
					
					if(twoid == 0){
						$("#sthreeid").html('');
					}else{
					
						//ajax
						$.ajax({
							type: "GET",
							url:  "{{url('home/user/area/three')}}",
							data: "twoid="+twoid,
							success: function(msg){
								$('#sthreeid').html(msg);
							}
						});
					
					}

				});
				
			}
		});
	
	}
	
});

});
</script>
<!--main-->
<div class="midder">
<div class="mc">

{{partial('user/set_menu')}}

	<div class="utable">
    <form method="POST" action="{{url('home/user/setcity')}}">
    <table cellpadding="0" cellspacing="0" width="100%" class="table_1">
    <tr>
    <th>常居地：</th>
    <td>
    {% if strarea['one'] is defined %}
    	{{strarea['one']['areaname']}}
    {% endif %}
 	
    {% if strarea['two'] is defined %}
    {{strarea['two']['areaname']}}
    {% endif %}
    
     {% if strarea['three'] is defined %}
    {{strarea['three']['areaname']}} 
    {% endif %}
    </td>
    </tr>
    
    <tr>
    <th>修改常居地：</th>
    <td>
    <select id="oneid" name="oneid" class="txt">
    <option value="0">请选择</option>
    {% for vo in arrOne %}
    <option value="{{vo['areaid']}}">{{vo['areaname']}}</option>
    {% endfor %}
    </select>
    <span id="stwoid"></span>
    <span id="sthreeid"></span>
    </td>
    </tr>
    <tr>
        <th></th>
        <td><input class="submit" type="submit" value="修改"  /></td>
    </tr>
    </table>
    </form>
    
    
    </div>
    
    
</div>
</div>